home *** CD-ROM | disk | FTP | other *** search
- DONATION.MOD
- Virus #1 @9813
- Thu Nov 28 02:12:33 1991
- ┌────────────────────────────────────────────────────────────────────────────┐
- │ Mod Name: DONATION.MOD Mod Author: Virus 1@9813 │
- │ Difficulty: █████▒ Date: 11/27/1991 │
- │ WWIV Version: 4.2 │
- │ Description: Adds DONATION information in User Record and shows at logon, │
- │ and in uedit. Official MoD Release │
- └────────────────────────────────────────────────────────────────────────────┘
-
- Basically what this does is adds a donation field and shows them how much
- they donated when the logon, when displaying their information, and in uedit.
-
- Legend:
- = Search for
- + Add
- - Delete
- % Change
-
- 1) VARDEC.H
-
- = sysopsub, /* sysop sub board number */
- % ontoday, /* num times on today */ /* Change the ; to , */
- + donation; /* amount of money donated */ /* Add this line */
- Save VARDEC.H
-
- 2) UEDIT.C
-
- In void print_data(blah blah) at the end
-
- = npr("Rest: %s\r\n",s2);
- = if (u->wwiv_regnum)
- = npr("WWIV: %ld\r\n", u->wwiv_regnum);
- + if (u->donation)
- npr("Donated: $%d.00\r\n", u->donation);
-
- Search for void uedit(blah blah)
-
- = prt(2,"Uedit : ");
- = if ((thisuser.sl==255) || (wfc))
- % ch=onek("Q[]{}/,.?UDRNLCPOGMSTEYZAI~:12345"); /* NOTE */
- = else
- % ch=onek("Q[]{}/,.?UDRNLCPOGMSTEYZAI12345"); /* NOTE */
-
- Now right below this code there will be some case statements. Go to the last
- case and right after the 'break;' add the following... (Mine is different
- cause I added some cases so I don't know what it should really be.)
-
- NOTE: You may or may not have as many commands as I do. So your will look
- different from mine. Just add a number or letter that isn't already
- used.
-
- = break;
- + case '5':
- + nl();
- + prt(2,"Enter Donation Total: ");
- + input(s,3);
- + i=atoi(s);
- + u.donation=i;
- + write_user(un,&u);
- + break;
- =}
-
- 3) LILO.C
-
- Search for void logon()
-
- = if (thisuser.ontoday==1)
- = npr("Last on : %s\r\n",thisuser.laston);
- = else
- = npr("Times on today : %d\r\n",thisuser.ontoday);
- + npr("Money Donated : $%d.00\r\n",thisuser.donation);
- = npr("Sysop is : %sAvailable\r\n",sysop2()?"":"NOT ");
-
- 4) BBSUTL.C
-
- Search for void yourinfo()
-
- = npr("Time spent on : %ld Minutes\r\n", (long)
- = ((thisuser.timeon+timer()-timeon)/60.0));
- + npr("Money Donated : $%d.00",thisuser.donation");
- = nl();
-
- 5) That's the whole mod. Now you have to use the following convert program
- to change your userlist to work properly. If you are in WWIVnet then read
- the docs about the NETINIT and whatnot. I'm not exactly sure how to do it
- with the net, but the docs tell you what to do. I have to read them myself.
-
- 6)Now, Put the following in a file called OLD.H
-
- typedef struct {
- char name[31], /* user's name */
- realname[21], /* user's real name */
- callsign[7], /* user's amateur callsign */
- phone[13], /* user's phone number */
- pw[9], /* user's password */
- laston[9], /* last date on */
- firston[9], /* first date on */
- note[41], /* sysop's note about user */
- macros[3][81], /* macro keys */
- sex; /* user's sex */
- unsigned char age, /* user's age */
- inact, /* if deleted or inactive */
- comp_type, /* computer type */
- defprot, /* deflt transfer protocol */
- defed, /* default editor */
- screenchars,screenlines,/* screen size */
- sl, /* security level */
- dsl, /* transfer security level */
- exempt, /* exempt from ratios, etc */
- colors[8], /* user's colors */
- votes[20], /* user's votes */
- illegal, /* illegal logons */
- waiting, /* number mail waiting */
- sysopsub, /* sysop sub board number */
- ontoday; /* num times on today */
- unsigned short homeuser,homesys, /* where user can be found */
- forwardusr,forwardsys, /* where to forward mail */
- msgpost, /* number messages posted */
- emailsent, /* number of email sent */
- feedbacksent, /* number of f-back sent */
- posttoday, /* number posts today */
- etoday, /* number emails today */
- ar, /* board access */
- dar, /* directory access */
- restrict, /* restrictions on account */
- ass_pts, /* bad things the user did */
- uploaded, /* number files uploaded */
- downloaded, /* number files downloaded */
- lastrate, /* last baud rate on */
- logons; /* total number of logons */
- unsigned long msgread, /* total num msgs read */
- uk, /* number of k uploaded */
- dk, /* number of k downloaded */
- qscn, /* which subs to n-scan */
- qscnptr[33], /* q-scan pointers */
- nscn1,nscn2, /* which dirs to n-scan */
- daten, /* numerical time last on */
- sysstatus; /* status/defaults */
- float timeontoday, /* time on today */
- extratime, /* time left today */
- timeon, /* total time on system */
- pos_account, /* $ credit */
- neg_account, /* $ debit */
- gold; /* game money */
- unsigned char bwcolors[8]; /* b&w colors */
- unsigned char month,day,year; /* user's birthday */
- unsigned int emailnet, /* email sent into net */
- postnet; /* posts sent into net */
- unsigned short fsenttoday1; /* feedbacks today */
- unsigned char num_extended; /* num lines of ext desc */
- unsigned char optional_val; /* optional lines in msgs */
- unsigned long wwiv_regnum; /* users WWIV reg number */
- char res[29]; /* reserved bytes */
- unsigned long qscn2; /* additional qscan ptr */
- unsigned long qscnptr2[64-32]; /* additional quickscan ptrs */
- } olduserrec;
-
- 7) Block read this next part into a NEW file and call it CONVERT.C and
- compile it. This compile program is Black Dragon's, only modified to suit
- the changes.
-
- /* CONVERT USERLIST PROGRAM */
-
- /* Written by The Black Dragon, 1989 */
- /* (C) 1989 Black Dragon Enterprises */
- /* Compiled and tested using Borland Turbo C - Version 1.5 */
- /* License granted to freely distribute without compensation and to */
- /* modify as needed "to get the job done." Use at your own risk. */
- /* Distributed "as is". No warranty or guarentee */
-
- /* Command Parameters: */
- /* CONVERT <old user filename> <new user filename> */
-
-
- #include <stdio.h>
- #include <string.h>
- #include <mem.h>
- #include <io.h>
- #include <fcntl.h>
- #include <sys\stat.h>
- #include "old.h" /* put your old userlist here and */
- #include "vardec.h" /* rename it from userrec to olduserrec */
-
- void main(int argc, char *argv[])
- {
- int f,g,i;
- unsigned int loop,num=0;
- unsigned long len;
- userrec new;
- olduserrec old;
-
- if (argc<3) {
- printf("\nRequires 2 parameters.\n");
- printf("Usage: CONVERT oldfile newfile \n");
- abort();
- }
- if ((f=open(argv[1],O_RDWR|O_BINARY,S_IREAD|S_IWRITE))<=0) {
- printf("\nCould not open user list %s\n",argv[1]);
- abort();
- }
- if ((g=open(argv[2],O_RDWR|O_BINARY|O_CREAT|O_TRUNC,S_IREAD|S_IWRITE))<=0) {
- printf("\nCould not open output file %s\n",argv[2]);
- abort();
- }
- printf("\n\nSize of old user record %d",sizeof(olduserrec));
- printf("\nSize of new user record %d\n\n",sizeof(userrec));
-
- len=filelength(f);
- num=(len/sizeof(olduserrec))+!(len%sizeof(olduserrec));
- for (loop=0;loop<num;loop++) {
- if (sizeof(olduserrec)==read(f,&old,sizeof(olduserrec))) {
- printf("\015Processing user #%u of %u",loop,num-1);
-
- memset(&new,0,sizeof(userrec)); /* Nice to clear out garbage */
- strcpy(new.name,old.name); /* Now copy all data over */
- strcpy(new.realname,old.realname);
- strcpy(new.callsign,old.callsign); /* Added this one */
- strcpy(new.phone,old.phone); /* added this one also */
- strcpy(new.pw,old.pw);
- strcpy(new.laston,old.laston);
- strcpy(new.firston,old.firston);
- strcpy(new.note,old.note);
- for (i=0;i<3;i++)
- strcpy(new.macros[i],old.macros[i]);
- new.sex=old.sex;
- new.age=old.age;
- new.inact=old.inact;
- new.comp_type=old.comp_type;
- new.defprot=old.defprot;
- new.defed=old.defed;
- new.screenchars=old.screenchars;
- new.screenlines=old.screenlines;
- new.sl=old.sl;
- new.dsl=old.dsl;
- new.exempt=old.exempt;
- for (i=0;i<8;i++)
- new.colors[i]=old.colors[i];
- for (i=0;i<20;i++)
- new.votes[i]=old.votes[i];
- new.illegal=old.illegal;
- new.waiting=old.waiting;
- new.sysopsub=old.sysopsub;
- new.ontoday=old.ontoday;
- new.homeuser=old.homeuser;
- new.homesys=old.homesys;
- new.forwardusr=old.forwardusr;
- new.forwardsys=old.forwardsys;
- new.msgpost=old.msgpost;
- new.emailsent=old.emailsent;
- new.feedbacksent=old.feedbacksent;
- new.posttoday=old.posttoday;
- new.etoday=old.etoday;
- new.ar=old.ar;
- new.dar=old.dar;
- new.restrict=old.restrict;
- new.ass_pts=old.ass_pts;
- new.uploaded=old.uploaded;
- new.downloaded=old.downloaded;
- new.lastrate=old.lastrate;
- new.logons=old.logons;
- new.msgread=old.msgread;
- new.uk=old.uk;
- new.dk=old.dk;
- new.qscn=old.qscn; /* copies existing n-scan ptrs */
- for(i=0;i<33;i++)
- new.qscnptr[i]=old.qscnptr[i];
- new.nscn1=old.nscn1;
- new.nscn2=old.nscn2;
- new.daten=old.daten;
- new.sysstatus=old.sysstatus;
- new.timeontoday=old.timeontoday;
- new.extratime=old.extratime;
- new.timeon=old.timeon;
- new.pos_account=old.pos_account;
- new.neg_account=old.neg_account;
- new.gold=old.gold;
- new.donation=0L;
- for (i=0;i<8;i++)
- new.bwcolors[i]=old.bwcolors[i];
- new.month=old.month;
- new.day=old.day;
- new.year=old.year;
- new.emailnet=old.emailnet;
- new.postnet=old.postnet;
- new.fsenttoday1=old.fsenttoday1;
- new.num_extended=old.num_extended;
- new.optional_val=old.optional_val;
- new.wwiv_regnum=old.wwiv_regnum;
- for (i=0;i<29;i++)
- new.res[i]=old.res[i];
- new.qscn2=old.qscn2;
- for (i=0;i<MAX_SUBS-32;i++)
- new.qscnptr2[i]=old.qscnptr2[i];
- write(g,&new,sizeof(userrec)); /* User record converted here */
- }
- }
- close(f);
- close(g);
- }
-
- 8) Copy CONVERT.EXE to your main bbs dir.
-
- 9) If your in WWIVnet then follow this step and #11, else skip em.
-
- Load up NETINIT.C (Comes with the network software) and compile it. If
- you use an old version, then it won't work, cause when you compile this,
- it reads VARDEC.H and you modified that, so this must know the changes.
-
- 10) Copy NETINIT.EXE into your WWIV dir.
-
- 11) Compile your BBS.
-
- 12) Copy BBS.EXE and RETURN.EXE to your WWIV dir.
-
- 13) Run NETINIT.EXE.
-
- 14) Backup your wwiv and data dirs for safety measures.
-
- 15) In your wwiv dir, run CONVERT.EXE.
-
- 16) Now your all done!!!. Ppppphhhheeeeewwwwww.
-
- 17) All you have to do now, is when someone donates money, just simply go
- into UEDIT and press the appropiate command. (Mine is 5) and your all
- set.
-
- If you have any questions, please feel free to E-Mail me at 1@9813.
-
- Also, if you are using this mod, or even considered using it, I'd like to
- know that my mod is being used by someone other than me. Thanks...